package com.gqzdev.ioc.annotation;

import com.gqzdev.ioc.bean.User;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;

import java.util.Collection;

/**
 * 通过注解方式  分析入口
 *
 * @ClassName: AnnotationBeanTest
 * @author: ganquanzhong
 * @date: 2020/7/3 9:33
 */
public class AnnotationBeanTest {


	public static void main(String[] args) {
		// AnnotationConfigApplicationContext 创建 应用上下文
		AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(JavaConfig.class);

//		String[] beanDefinitionNames = applicationContext.getBeanDefinitionNames();
//		Collection<ApplicationListener<?>> applicationListeners = applicationContext.getApplicationListeners();
//		for (String beanDefinitionName : applicationContext.getBeanDefinitionNames()) {
//			System.out.println(beanDefinitionName);
//		}
//		applicationContext.getBeanDefinitionNames();

//		User bean = applicationContext.getBean(User.class);
//		System.out.println(bean);

	}
}
